<template>
	<view class="contain">
		<text class="msg-tlt">{{ msgDetail.title }}</text>
		<view class="time">{{ msgDetail.create_time }}</view>
		<rich-text :nodes="msgDetail.content" class="msg-content"></rich-text>
	</view>
</template>

<script>
const app = getApp()
export default {
	data() {
		return {
			msgDetail: {}
		}
	},
	onLoad(options) {
		console.log(options)
		this.msgDetail = JSON.parse(options.msg)
		this.setReadMsg()
	},
	methods: {
		setReadMsg() {
			uni.showLoading({
				title: '加载中...',
				mask: true
			})
			/* prettier-ignore */
			this.$https(true, 'post', {
				url: '/Home/Msg/read',
				data: {
					token: uni.getStorageSync('token'),
					id: this.msgDetail.id
					}
			},(res) => {
			})
			/* prettier-ignore */
		}
	}
}
</script>

<style scoped>
.contain {
	padding: 0 24rpx;
}
.time {
	font-size: 26rpx;
	color: #999;
	margin: 14rpx 0 28rpx;
}
.msg-tlt {
	font-weight: 600;
	font-size: 32rpx;
	color: #333;
}
.msg-content {
	width: 100%;
	margin-top: 14rpx;
	color: #999;
}
</style>
